<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Payment</title>
<script type="text/javascript" src="validateInformation.js" ></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
require_once 'UpdateManager.php';
if(isset($_POST['Done']))
{
	$snum = $_SESSION['snum'];
	$pterm=$_POST['paymentTerm'];
	$term=$_POST['periodCovered'];
	$duration=$_POST['months'];
	$pporno=$_POST['paymentOrno'];
	$df=$_POST['dormFee'];
	$af=$_POST['appFee'];
	$tf=$_POST['transFee'];
	$remarks=$_POST['remarks'];
	$paydate=$_POST['paymentDate'].$_POST['appMonth'].$_POST['appYear'];

	$f = UpdateManager::updatePayment($snum,$pterm,$term,$pporno,$df,$af,$tf,$paydate,$remarks,$duration);
	if($f){
		UpdateManager::showMessage($f);
	}else{
		UpdateManager::showMessage(0);
	}
}

?>

</head>

<body>
<table width="100%" border="0" cellpadding="1">
 
  <tr>
    <td>&nbsp;</td>
    <td class="subBanner"><strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Edit Resident Payment </strong></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><form id="form1" name="form1" method="post" action="" onsubmit="return validateInformation8(this)">
      <table width="100%" border="0" cellpadding="1">
        <tr>
          <td>&nbsp;</td>
          <td><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong>&nbsp;</td>
          <td id="lname2" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td width="37%"><strong>Term</strong></td>
          <td width="34%"><strong>
            <input type="radio" name="paymentTerm" id="gender" value="first" <?php if($_SESSION['term']=="FIRST")echo "checked='checked'"?>/>
First Semester
<input type="radio" name="paymentTerm" id="gender2" value="second" <?php if($_SESSION['term']=="SECOND")echo "checked='checked'"?>/>
Second Semester
<input type="radio" name="paymentTerm" id="gender3" value="summer" <?php if($_SESSION['term']=="SUMMER")echo "checked='checked'"?>/>
Summer</strong></td>
          <td width="29%" id="pterm" class="error">&nbsp;</td>
        </tr>
        
		
		
		<tr>
          <td>Period Covered</td>
          <td><strong>
            <input name="periodCovered" type="text" id="fatherOccupation" size="40" value="<?php echo $_SESSION['periodcovered']?>"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;          </strong></td>
          <td id="gaddress" class="error">&nbsp;</td>
        </tr>
		<tr>
		
		
		
          <td>Number of Months Paid</td>
          <td><strong>
            <input name="months" type="text" id="fatherOccupation" size="40" value="<?php echo $_SESSION['months']?>"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;          </strong></td>
          <td id="gaddress" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Receipt Number</td>
          <td><strong>
            <input name="paymentOrno" type="text" id="fatherIncome" size="40" maxlength="7" value="<?php echo $_SESSION['receipt']?>"/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            </strong></td>
          <td id="pporno" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Dorm Fee</td>
          <td><strong>
            <input name="dormFee" type="text" id="fatherIncome" size="40" value="<?php echo $_SESSION['dormfee']?>"/>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="df" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Appliance Fee</td>
          <td><strong>
            <input name="appFee" type="text" id="fatherIncome" size="40" value="<?php echo $_SESSION['appfee']?>"/>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="af" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Transient Fee</td>
          <td><strong>
            <input name="transFee" type="text" id="fatherIncome" size="40" value="<?php echo $_SESSION['transfee']?>"/>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
          <td id="tf" class="error">&nbsp;</td>
        </tr>
        <tr>
		 <?php
			$dd=substr($_SESSION['datepaid'],0,2);			
			$mm=substr($_SESSION['datepaid'],2,3);
			$yy=substr($_SESSION['datepaid'],5,4);
		  ?>
		
		
          <td>Date Paid</td>
          <td><select name="appMonth" id="bdMonth">
			  <option value="JAN" <?php if($mm=='JAN')echo "selected='selected'"?>>January</option>
              <option value="FEB" <?php if($mm=='FEB')echo "selected='selected'"?>>February</option>
              <option value="MAR" <?php if($mm=='MAR')echo "selected='selected'"?>>March</option>
              <option value="APR" <?php if($mm=='APR')echo "selected='selected'"?>>April</option>
              <option value="MAY" <?php if($mm=='MAY')echo "selected='selected'"?>>May</option>
              <option value="JUN" <?php if($mm=='JUN')echo "selected='selected'"?>>June</option>
              <option value="JUL" <?php if($mm=='JUL')echo "selected='selected'"?>>July</option>
              <option value="AUG" <?php if($mm=='AUG')echo "selected='selected'"?>>August</option>
              <option value="SEP" <?php if($mm=='SEP')echo "selected='selected'"?>>September</option>
              <option value="OCT" <?php if($mm=='OCT')echo "selected='selected'"?>>October</option>
              <option value="NOV" <?php if($mm=='NOV')echo "selected='selected'"?>>November</option>
              <option value="DEC" <?php if($mm=='DEC')echo "selected='selected'"?>>December</option>
			  </select>
&nbsp;
<label for="bdDay"></label>
<label for="bdDate"></label>
<input name="paymentDate" type="text" size="3" value="<?php echo $dd;?>"/>
&nbsp;
<label for="bdYear"></label>
<select name="appYear" >
<?php
$ys=1985;
$ye=2011;

for(;$ys <= $ye; $ys++)
{
	echo "<option value='1985'"; if($yy==$ys)echo "selected='selected'"; echo ">" . $ys . "</option>";
}
?>
</select>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td id="paydate" class="error">&nbsp;</td>
        </tr>
        <tr>
          <td>Remarks</td>
          <td><textarea name="remarks" cols="35" rows="4"><?php echo $_SESSION['remarks']?></textarea>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Done" id="Done" value="Done" /></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td></td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
